Controlling Record Navigation with the Invoice Toolbar

Description

Describes record navigation buttons and how to create a toolbar utilizing using these buttons. This page also covers how to attach this toolbar to a form.

The normal behavior of the record navigation buttons (below) is defined by the item on form that has focus.

images/Move_First_Button_2.gif
images/Move_Previous_Button.gif
images/Move_Next_Button.gif
images/Move_Last_Button_2.gif

Assume you have a form with an embedded browse. Place the cursor on a form field. The forwards and backwards record navigation will be defined by the currently activate table index. Place the cursor on the browse. Now, forward and backwards record navigation will be defined by the records of the browse. The Invoice toolbar redefines the meaning of the navigation buttons, so that they always move forwards and backwards through the form's records, even if the cursor is on the embedded browse.

Procedure: Creating a Toolbar with Redefined Navigation Buttons

  1. Click the Code tab of the Control Panel.

  2. Select New > Toolbar.

  3. Select "Form View Toolbar" and click OK.

    images/UG_New_Toolbar_dialog.gif
  4. Select the First button . Change the Button Action field to "Run Xbasic". Enter the following Xbasic code into the type-in box.

    topparent.fetch_first()
    images/Move_First_Button_2.gif
  5. Select the Previous button . Change the Button Action field to "Run Xbasic". Enter the following Xbasic code into the type-in box.

    topparent.fetch_prev()
    images/Move_Previous_Button.gif
  6. Select the Next button . Change the Button Action field to "Run Xbasic". Enter the following Xbasic code into the type-in box.

    topparent.fetch_next()
    images/Move_Next_Button.gif
  7. Select the Last button . Change the Button Action field to "Run Xbasic". Enter the following Xbasic code into the type-in box.

    topparent.fetch_last()
    images/Move_Last_Button_2.gif
  8. Click Save As, enter the toolbar's name in the Name field, and click OK.

Procedure: Attaching a Toolbar to a Form

  1. Right click on the form's background.

  2. Select Properties....

  3. Click the Menus/Toolbars tab.

  4. Select the new toolbar in the Toolbars/Views list.

  5. Click OK.

See Also